package com.yupi.springbootinit.config;/*
@author name
@data 2025/3/10-15:43
*/

import io.github.briqt.spark4j.SparkClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "ai")   //todo 解决下划线
@Data
public class XinHuoConfig {

    @Value("${ai.appid}")
    public String appid;

    @Value("${ai.apiSecret}")
    public String apiSecret;

    @Value("${ai.apiKey}")
    public String apiKey;

   @Bean
    public SparkClient sparkClient(){
       SparkClient sparkClient = new SparkClient();
       sparkClient.apiKey = apiKey;
       sparkClient.appid = appid;
       sparkClient.apiSecret = apiSecret;
       return sparkClient;
   }
}
